using System;
using System.Collections.Generic;
using System.Data.SqlTypes;

namespace eShop.Model
{
    public class Product
    {
        #region _Active

        public int ProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductDescription { get; set; }
        public string Specification { get; set; }
        public int CategoryId { get; set; }
        public int BrandId { get; set; }
        public string ItemNumber { get; set; }
        public string DisplayOrder { get; set; }
        public string ProductImageUrl { get; set; }
        public string ProductUrl { get; set; }
        public double RetailPrice { get; set; }
        public double ProductPrice { get; set; }
        public double ClearencePrice { get; set; }

        public bool IsNewArrival { get; set; }
        public bool IsFeatured { get; set; }
        public bool IsActive { get; set; }
        public bool IsClearenceItem { get; set; }
        public List<ProductStock> Stocks { get; set; }
        public List<ProductImage> AdditionalImages { get; set; }

        public Manufacturer Brand { get; set; }
        public Category Category { get; set; }

        #endregion


        #region Product Constructor

        public Product() { Stocks = new List<ProductStock>(); AdditionalImages = new List<ProductImage>(); }

        public Product
        (
            int productId,
            string productName,
            string productName2,
            string productDescription,
            string productImageUrl,
            string displayOrder,
            int visitCount,
            double oldPrice,
            double retailPrice,
            double additionalPrice,
            string additionalPriceDesc,
            string recipies,
            string additionalinfo,
            DateTime createDate,
            string itemNumber,
            bool isFeatured,
            bool isFreeShipping,
            bool isNewArrival,
            bool isActive,
            bool isDeleted,
            bool isClearenceItem,
            string productUrl,
            double productPrice,
            double currentCost,
            double standardCost,
            bool isSpecial,
            Manufacturer productBrand,
            Category productCategory,
            List<ProductStock> stocks
        )
        {
            ProductId = productId;
            ProductName = productName;
            ProductDescription = productDescription;
            ProductImageUrl = productImageUrl;
            DisplayOrder = displayOrder;
            RetailPrice = retailPrice;
            Specification = additionalinfo;
            ItemNumber = itemNumber;
            IsFeatured = isFeatured;
            IsNewArrival = isNewArrival;
            IsActive = isActive;
            IsClearenceItem = isClearenceItem;
            ProductUrl = productUrl;
            ProductPrice = productPrice;
            Stocks = stocks;
            AdditionalImages = new List<ProductImage>();
        }
        #endregion


        #region _INACTIVE
        
        public string ProductImageSmallThumbnail
        {
            get { return ProductImageUrl.Replace("original", "smallthumb"); }
        }

        public string ProductImageLargeThumbnail
        {
            get { return ProductImageUrl.Replace("original", "largethumb"); }
        }

        public string ProductImageDetailSize
        {
            get { return ProductImageUrl.Replace("original", "detail"); }
        }
        #endregion
    }
}
